widget: Remove gtk_widget_get_allocated_size()
authorBenjamin Otte <otte@redhat.com>
Tue, 19 Feb 2019 07:09:57 +0000 (08:09 +0100)
committerBenjamin Otte <otte@redhat.com>
Tue, 19 Feb 2019 18:29:58 +0000 (19:29 +0100)
Use gtk_widget_get_allocated_width/height in the only user (GtkStack),
even though that isn't 100% correct.

gtk/gtkstack.c
gtk/gtkwidget.c
gtk/gtkwidget.h

index 003bc2088e6640220b96ba4ba732f6ae8671910f..94de6d830ba3d62e0e179c3d4cf7968002e8d136 100644 (file)
@@ -1195,12 +1195,9 @@ set_visible_child (GtkStack               *stack,
     {
       if (gtk_widget_is_visible (widget))
         {
-          GtkAllocation allocation;
-
           priv->last_visible_child = priv->visible_child;
-          gtk_widget_get_allocated_size (priv->last_visible_child->widget, &allocation, NULL);
-          priv->last_visible_widget_width = allocation.width;
-          priv->last_visible_widget_height = allocation.height;
+          priv->last_visible_widget_width = gtk_widget_get_allocated_width (priv->last_visible_child->widget);
+          priv->last_visible_widget_height = gtk_widget_get_allocated_height (priv->last_visible_child->widget);
         }
       else
         {
index 31ade6ded0830848dcb5fc854e102c11b84b5e57..f22581d0ab838471680cfc00f831388de4a1aee7 100644 (file)
@@ -11099,41 +11099,6 @@ gtk_widget_get_has_tooltip (GtkWidget *widget)
   return priv->has_tooltip;
 }
 
-/**
- * gtk_widget_get_allocated_size:
- * @widget: a #GtkWidget
- * @allocation: (out): a pointer to a #GtkAllocation to copy to
- * @baseline: (out) (allow-none): a pointer to an integer to copy to
- *
- * Retrieves the widget’s allocated size.
- *
- * This function returns the last values passed to
- * gtk_widget_size_allocate(). The value differs from
- * the size returned in gtk_widget_get_allocation() in that functions
- * like gtk_widget_set_halign() can adjust the allocation, but not
- * the value returned by this function.
- *
- * If a widget is not visible, its allocated size is 0.
- */
-void
-gtk_widget_get_allocated_size (GtkWidget     *widget,
-                               GtkAllocation *allocation,
-                               int           *baseline)
-{
-  GtkWidgetPrivate *priv = gtk_widget_get_instance_private (widget);
-
-  g_return_if_fail (GTK_IS_WIDGET (widget));
-  g_return_if_fail (allocation != NULL);
-
-  allocation->x = graphene_matrix_get_value (&priv->allocated_transform, 3, 0);
-  allocation->y = graphene_matrix_get_value (&priv->allocated_transform, 3, 1);
-  allocation->width = priv->allocated_width;
-  allocation->height = priv->allocated_height;
-
-  if (baseline)
-    *baseline = priv->allocated_size_baseline;
-}
-
 /**
  * gtk_widget_get_allocation:
  * @widget: a #GtkWidget
index 1d06747d5776ac8071d6e02113f64af339dc55e9..f57f64b5ee7b770a7589eabbfbbd7f478c9d9061 100644 (file)
@@ -605,10 +605,6 @@ GDK_AVAILABLE_IN_ALL
 int                   gtk_widget_get_allocated_height   (GtkWidget     *widget);
 GDK_AVAILABLE_IN_ALL
 int                   gtk_widget_get_allocated_baseline (GtkWidget     *widget);
-GDK_AVAILABLE_IN_ALL
-void                  gtk_widget_get_allocated_size     (GtkWidget     *widget,
-                                                         GtkAllocation *allocation,
-                                                         int           *baseline);
 
 GDK_AVAILABLE_IN_ALL
 void                  gtk_widget_get_allocation         (GtkWidget     *widget,